/*
 * Copyright (c) 2020 hebeiyiliuba.com
 * All rights reserved.
 *
 */
package org.jeecg.modules.third.oapi.alct56.service;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.itextpdf.text.pdf.BaseFont;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.ImageCompressUtil;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.WaterMarkUtil;
import org.jeecg.modules.third.aliyunocr.utils.HttpUtils;
import org.jeecg.modules.third.digitalseal.utils.PdfToImageUtil;
import org.jeecg.modules.third.oapi.alct56.constant.OapiAlct56Constant;
import org.jeecg.modules.third.oapi.alct56.constant.enums.ImageCategory;
import org.jeecg.modules.third.oapi.alct56.constant.enums.ImageType;
import org.jeecg.modules.third.oapi.alct56.dto.AlctApiBaseResDTO;
import org.jeecg.modules.third.oapi.alct56.dto.ApiTokenResDTO;
import org.jeecg.modules.third.oapi.alct56.dto.req.driver.DriverDTO;
import org.jeecg.modules.third.oapi.alct56.dto.req.driver.DrivingLicense;
import org.jeecg.modules.third.oapi.alct56.dto.req.driver.Identity;
import org.jeecg.modules.third.oapi.alct56.dto.req.driver.Taxpayer;
import org.jeecg.modules.third.oapi.alct56.dto.req.image.ImageDTO;
import org.jeecg.modules.third.oapi.alct56.dto.req.image.ShippingImageDTO;
import org.jeecg.modules.third.oapi.alct56.dto.req.shippingnote.*;
import org.jeecg.modules.third.oapi.alct56.dto.req.vehicle.VehicleDTO;
import org.jeecg.modules.third.oapi.alct56.utils.SM2Utils;
import org.jeecg.modules.wlhy.utils.HyCfgUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import zyb.org.bouncycastle.crypto.InvalidCipherTextException;

import javax.annotation.PostConstruct;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * 陆交开放平台
 * 辽宁省税务对接
 * @author duanlikao
 * @created 2021/7/7
 */
@Service
@Slf4j
public class OapiAlct56Service {
    private static final Logger LOGGER = LoggerFactory.getLogger(OapiAlct56Service.class);

    @Value(value="${ln-tax-platform.domain:http://61.161.232.25:31002/freight-tax}")
    private String LN_TAX_DOMIAN;

    @Value(value="${ln-tax-platform.enterpriseCode:E0023020}")
    private String LN_TAX_ENTERPRISE;

    @Value(value="${ln-tax-platform.enterpriseIdentity:aea8ac9bd73c945aebe5ca3dc806e254}")
    private String LN_TAX_IDENTITY;

    @Value(value="${ln-tax-platform.enterpriseKey:e2cd00a2dd831e5435699b2d09e3f259}")
    private String LN_TAX_KEY;

    @Value(value="${ln-tax-platform.publicKey:}")
    private String LN_TAX_SM2_PUBLICKEY;

    @Value(value="${ln-tax-platform.privateKey:}")
    private String LN_TAX_SM2_PRIVATEKEY;

    @Value(value = "${jeecg.path.upload}")
    private String uploadpath;

    @Autowired
    private RedisUtil redisUtil;


    /**
     * 获取Token
     * @return
     */
    public String getToken(){

        if (StrUtil.isEmpty(LN_TAX_DOMIAN) || StrUtil.isEmpty(LN_TAX_ENTERPRISE) || StrUtil.isEmpty(LN_TAX_IDENTITY) || StrUtil.isEmpty(LN_TAX_KEY)) {
            throw new JeecgBootException("航信税务平台参数配置错误");
        }

        Object tokenObject  = redisUtil.hasKey(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY) ?
                redisUtil.get(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY) : null;

        String token = StringUtils.EMPTY;
        if (null == tokenObject) {
                String path = "/api/v1/openapi/enterprises/login";
                Map <String, String> headers = new HashMap <>();
                //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
                //        headers.put("Authorization", "Bearer " + token);
                //        //根据API的要求，定义相对应的Content-Type
                headers.put("Content-Type", "application/json; charset=UTF-8");
                Map<String, String> querys = new HashMap<>();
                // 拼装请求body的json字符串
                JSONObject requestObj = new JSONObject();
                log.info("{}, {}, {}， {}", LN_TAX_DOMIAN, LN_TAX_ENTERPRISE, LN_TAX_IDENTITY, LN_TAX_KEY);

                requestObj.put("enterpriseCode", LN_TAX_ENTERPRISE);
                requestObj.put("enterpriseIdentity", LN_TAX_IDENTITY);
                requestObj.put("enterpriseKey", LN_TAX_KEY);
                String bodys = requestObj.toString();

                try {
                    HttpResponse response = HttpUtils.doPost(LN_TAX_DOMIAN, path, "POST", headers, querys, bodys);
                    int stat = response.getStatusLine().getStatusCode();
                    if(stat != 200){
                        log.info("OapiAlct56Service getToken Http code: :{}  | http header error msg:{} | Http body error msg: ",
                                stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
                        return StringUtils.EMPTY;
                    }
                    String res = EntityUtils.toString(response.getEntity());
                    log.info("辽宁航信税务获取Token回执 <- {} ",res);
                    ApiTokenResDTO result = JSONObject.parseObject(res, ApiTokenResDTO.class);
                    //log.info("辽宁税务航信获取Token回执 <- {} ",JSONUtil.toJsonStr(result));
                    if (result.getCode().equals("0") && StringUtils.isNotEmpty(result.getToken())) {

                        redisUtil.set(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY, result.getToken(), result.getExpiryIn());
                        redisUtil.set(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY, result.getRefreshToken(), result.getExpiryIn());

                        return result.getToken();
                    }
                    return StringUtils.EMPTY;
                } catch (Exception e) {
                    log.info("OapiAlct56Service getToken Exception :{} ",e.getMessage());
                }
        } else {
            //当token不为空时判断刷新token时间，如果到时间了要刷新token
            long expireTimes = redisUtil.getExpire(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
            Object refreshToken = redisUtil.get(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
            //当前小于2个小时刷新一次Token
            if (null != refreshToken && expireTimes < (2 * 3600)) {
                log.info("辽宁航信税务Token: {} {} , refresh剩余时间 {} .", tokenObject, refreshToken, expireTimes);
                return getRefreshtoken();
            }
        }

        return tokenObject != null && StringUtils.isNotEmpty(tokenObject.toString())
                ? tokenObject.toString() : token;
    }

    /**
     * token过期前1个小时或更早用refreshToken来获取新的token。
     * @return
     */
    public String getRefreshtoken(){
        Object tokenObject  = redisUtil.hasKey(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY) ?
                redisUtil.get(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY) : null;
        if (tokenObject == null ) {
            return StringUtils.EMPTY;
        }
        String path = "/api/v1/openapi/enterprises/refresh-token/" + tokenObject.toString();
        Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        //        headers.put("Authorization", "Bearer " + token);
        //        //根据API的要求，定义相对应的Content-Type
        headers.put("Content-Type", "application/json; charset=UTF-8");
        Map<String, String> querys = new HashMap<>();
        String bodys = "";
        try {
            log.info("辽宁航信税务刷新Token请求 -> {} {}", path, tokenObject);
            HttpResponse response = HttpUtils.doPost(LN_TAX_DOMIAN, path, "POST", headers, querys, bodys);
            int stat = response.getStatusLine().getStatusCode();
            if(stat != 200){
                log.info("OapiAlct56Service getRefreshtoken Http code: :{}  | http header error msg:{} | Http body error msg: ",
                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
                return StringUtils.EMPTY;
            }
            String res = EntityUtils.toString(response.getEntity());
            log.info("辽宁航信税务刷新Token回执 <- {} ",res);
            ApiTokenResDTO result = JSONObject.parseObject(res, ApiTokenResDTO.class);
            if(result.getCode().equals("0") && StringUtils.isNotEmpty(result.getToken())){
                redisUtil.set(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY, result.getToken(), result.getExpiryIn());
                redisUtil.set(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY, result.getRefreshToken(), result.getExpiryIn());
                return result.getToken();
            }
            return StringUtils.EMPTY;
        } catch (Exception e) {
            log.info("OapiAlct56Service getRefreshtoken Exception :{} ",e.getMessage());
        }

        return StringUtils.EMPTY;
    }

    /**
     * 创建运单
     * @param bodyDTO
     * @return
     */
    public AlctApiBaseResDTO createShippingNote(BodyDTO bodyDTO){
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        if (bodyDTO == null) {
            result.setMessage(" bodyDTO 为空");
            return result;
        }
        String token = getToken();
        if (StringUtils.isEmpty(token)) {
            result.setMessage(" token 为空");
            return result;
        }

        //Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        //headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        //headers.put("Content-Type", "application/json; charset=UTF-8");
        //Map<String, String> querys = new HashMap<>();
        // 拼装请求body的json字符串
        //String enterpriseCode = HyCfgUtil.getCfgItem("liaoning_tax_report","enterpriseCode");
        RootDTO rootDTO = new RootDTO();
        HeadDTO headDTO = new HeadDTO();
        headDTO.setSenderCode(LN_TAX_ENTERPRISE);
        headDTO.setMessageReferenceNumber(UUID.randomUUID().toString().replace("-", ""));
        headDTO.setMessageSendingDateTime(
                DateUtils.dateTimeToStringT(new Date())
        );
        rootDTO.setHead(headDTO);
        rootDTO.setBody(bodyDTO);
        String bodys = JSONObject.toJSONString(rootDTO);

        try {
            String path = "/api/v1/openapi/shipments";
            log.info("创建辽宁航信税务运单请求 -> {} {}", LN_TAX_DOMIAN + path, bodys);
            bodys = SM2Utils.encryptByPublicKey(bodys, LN_TAX_SM2_PUBLICKEY);
//            log.info("加密后报文: {}", bodys);
//            HttpResponse response = HttpUtils.doPost(LN_TAX_DOMIAN, path, "POST", headers, querys, bodys);
//            int stat = response.getStatusLine().getStatusCode();
//            if (stat != 200) {
//                log.info("OapiAlct56Service createShippingNote Http code: :{}  | http header error msg:{} | Http body error msg: ",
//                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
//                result.setCode(String.valueOf(stat));
//                result.setMessage(response.getFirstHeader("X-Ca-Error-Message").toString());
//                return result;
//            }

            cn.hutool.http.HttpResponse response = HttpRequest.post(LN_TAX_DOMIAN + path)
                    .header("Content-Type", "application/json; UTF-8")
                    .header("Authorization","Bearer " + token)
                    .body(bodys)
                    .execute();

            String res = response.body();
            log.info("创建辽宁航信税务运单回执, {}", res);
            if (res.contains("token校验验证错误")) {
                String freshToken = getRefreshtoken();
                if (StrUtil.isEmpty(freshToken)) {
                    Thread.sleep(200);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                }
            }

//            AlctApiBaseResDTO resdto = JSONObject.parseObject(res, AlctApiBaseResDTO.class);
//            String decodeMessage = SM2Utils.decryptByPrivateKey(resdto.getMessage(), LN_TAX_SM2_PRIVATEKEY);
//            resdto.setMessage(decodeMessage);
            return JSONObject.parseObject(res, AlctApiBaseResDTO.class);
        } catch (Exception e) {
            log.info("OapiAlct56Service createShippingNote Exception :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }
        return result;
    }


    /**
     * 创建运单
     * @param
     * @return
     */
    public AlctApiBaseResDTO getAlctShippingNote(String shippingNoteNumber){
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        String token = getToken();
        if(StringUtils.isEmpty(token)){
            result.setMessage(" token 为空");
            return  result;
        }

        Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        headers.put("Content-Type", "application/json; charset=UTF-8");
        Map<String, String> querys = new HashMap<>();
//        querys.put("shipmentCode", shippingNoteNumber);
//        querys.put("content", "status");

        try {
            String status = SM2Utils.encryptByPublicKey("status", LN_TAX_SM2_PUBLICKEY);
            shippingNoteNumber = SM2Utils.encryptByPublicKey(shippingNoteNumber, LN_TAX_SM2_PUBLICKEY);

            String path = "/api/v1/openapi/shipments?content=" + status + "&shipmentCode=" + shippingNoteNumber;
            log.info("辽宁税务获取运单请求 -> {} {}", LN_TAX_DOMIAN + path);
            HttpResponse response = HttpUtils.doGet(LN_TAX_DOMIAN, path, "GET", headers, querys);
            int stat = response.getStatusLine().getStatusCode();
            log.info("辽宁税务获取运单状态回执 <- {}", JSONUtil.toJsonStr(response.getStatusLine()));
            if(stat != 200){
                log.warn("辽宁税务获取运单回执<- Http code: :{}  | http header error msg:{} | Http body error msg: ",
                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
                result.setCode(String.valueOf(stat));
                result.setMessage(response.getFirstHeader("X-Ca-Error-Message").toString());
                return result;
            }

            String res = EntityUtils.toString(response.getEntity());
            if (res.contains("token校验验证错误")) {
                String freshToken = getRefreshtoken();
                if (StrUtil.isEmpty(freshToken)) {
                    Thread.sleep(200);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                }
            }

            return JSONUtil.toBean(res, AlctApiBaseResDTO.class, true);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("辽宁税务获取运单状态回执异常 :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }

        return result;
    }

    public AlctApiBaseResDTO uploadHistoryShippingNote(HistoryDataBodyDTO bodyDTO) {
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        String token = getToken();
        if (StringUtils.isEmpty(token)) {
            result.setMessage("Token 为空");
            return result;
        }

        RootDTO rootDTO = new RootDTO();
        HeadDTO headDTO = new HeadDTO();
        headDTO.setSenderCode(LN_TAX_ENTERPRISE);
        headDTO.setMessageReferenceNumber(UUID.randomUUID().toString().replace("-", ""));
        headDTO.setMessageSendingDateTime(DateUtils.dateTimeToStringT(new Date()));
        rootDTO.setHead(headDTO);
        rootDTO.setBody(bodyDTO);

        String bodys = JSONObject.toJSONString(rootDTO);
        try {
            String path = "/api/v1/openapi/hisdata";
            log.info("补传辽宁航信税务历史运单请求 -> {} {}", LN_TAX_DOMIAN + path, bodys);
            bodys = SM2Utils.encryptByPublicKey(bodys, LN_TAX_SM2_PUBLICKEY);
            //log.info("加密后报文: {}", bodys);

            cn.hutool.http.HttpResponse response = HttpRequest.post(LN_TAX_DOMIAN + path)
                    .header("Content-Type", "application/json; UTF-8")
                    .header("Authorization","Bearer " + token)
                    .body(bodys)
                    .execute();
//
//            HttpResponse response = HttpUtils.doPost(LN_TAX_DOMIAN, path, "POST", headers, querys, bodys);
//            int stat = response.getStatusLine().getStatusCode();
//            if (stat != 200) {
//                log.info("OapiAlct56Service createShippingNote Http code: :{}  | http header error msg:{} | Http body error msg: ",
//                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
//                result.setCode(String.valueOf(stat));
//                result.setMessage(response.getFirstHeader("X-Ca-Error-Message").toString());
//                return result;
//            }

            String res = response.body();
            log.info("补传辽宁航信税务历史运单回执, {}", res);
            if (res.contains("token校验验证错误")) {
                String freshToken = getRefreshtoken();
                if (StrUtil.isEmpty(freshToken)) {
                    Thread.sleep(200);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                }
            }

            return JSONObject.parseObject(res, AlctApiBaseResDTO.class);
        } catch (Exception e) {
            log.info("OapiAlct56Service createShippingNote Exception :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }

        return result;
    }



    /**
     * 同步执行运单的车辆轨迹数据
     * 建议开发者在运单结束后一次性上传车辆的轨迹，上传轨迹的数量，最多2000个。超过2000个，界面不显示。
     *
     * 如果多次上传，每次只需要上传新的位置点，如第一次上传1:00, 1:05,1:10的轨迹，则第二次上传1:15, 1:20, 1:25, 1:30 的轨迹。
     * @param tracesDTO
     * @return
     */
    public AlctApiBaseResDTO syncTraces(TracesDTO tracesDTO){
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        if(tracesDTO == null){
            result.setMessage(" tracesDTO 为空");
            return  result;
        }
        String token = getToken();
        if(StringUtils.isEmpty(token)){
            result.setMessage(" token 为空");
            return  result;
        }

        //Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        //headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        //headers.put("Content-Type", "application/json; charset=UTF-8");
        //Map<String, String> querys = new HashMap<>();
        // 拼装请求body的json字符串
        String bodys = JSONUtil.toJsonStr(tracesDTO);
        try {
            bodys = SM2Utils.encryptByPublicKey(bodys, LN_TAX_SM2_PUBLICKEY);

            String path = "/api/v1/openapi/traces";
            cn.hutool.http.HttpResponse response = HttpRequest.post(LN_TAX_DOMIAN + path)
                    .header("Content-Type", "application/json; UTF-8")
                    .header("Authorization","Bearer " + token)
                    .body(bodys)
                    .execute();

            log.info("辽宁税务同步轨迹请求 -> {} {}", LN_TAX_DOMIAN + path, JSONUtil.toJsonStr(response));
            int stat = response.getStatus();
            if (stat == 200 || stat == 204) {
                log.info("辽宁税务同步轨迹回执 <- :{} ", response.body());
                result = JSONObject.parseObject(response.body(), AlctApiBaseResDTO.class);
                if (null != result && "token校验验证错误".equals(result.getMessage())) {
                    String freshToken = getRefreshtoken();
                    if (StrUtil.isEmpty(freshToken)) {
                        Thread.sleep(200);
                        redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                        redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                    }
                }

                result.setCode(result.getCode());
                result.setMessage(result.getMessage());
                return result;
            }

            log.info("辽宁税务同步轨迹失败日志: {} ", JSONUtil.toJsonStr(response.body()));
            result = JSONObject.parseObject(response.body(), AlctApiBaseResDTO.class);
            result.setCode(String.valueOf(stat));
            result.setMessage(result.getCode() + " , " + result.getMessage());
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            log.info("辽宁税务同步轨迹异常 :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }
        return result;
    }

    /**
     * 回单照片上传
     * @param imagesDTO
     * @return
     */
    public AlctApiBaseResDTO upImages(ShippingImageDTO imagesDTO){
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        String token = getToken();
        if(StringUtils.isEmpty(token)){
            result.setMessage("Token为空");
            return result;
        }

        String path = "/api/v1/openapi/shipments/podimages";
        Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        headers.put("Content-Type", "application/json; charset=UTF-8");
        Map<String, String> querys = new HashMap<>();
        // 拼装请求body的json字符串
        String bodys = JSONObject.toJSONString(imagesDTO);
        log.info("辽宁税务后台上传回单请求-> {} ,{}",LN_TAX_DOMIAN + path, imagesDTO.getShipmentCode());
        try {
            bodys = SM2Utils.encryptByPublicKey(bodys, LN_TAX_SM2_PUBLICKEY);

            HttpResponse response = HttpUtils.doPost(LN_TAX_DOMIAN, path, "POST", headers, querys, bodys);
            int stat = response.getStatusLine().getStatusCode();
            if(stat != 200){
                log.info("OapiAlct56Service upImages Http code: :{}  | http header error msg:{} | Http body error msg: ",
                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
                result.setCode(String.valueOf(stat));
                result.setMessage(response.getFirstHeader("X-Ca-Error-Message").toString());
                return result;
            }
            //String res = EntityUtils.toString(response.getEntity());
            log.info("辽宁税务后台上传回单回执 <- {} ", stat);
            result.setCode("0");
            return result;
        } catch (Exception e) {
            log.info("OapiAlct56Service upImages Exception :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }
        return result;
    }

    /**
     * 更新运单运费
     * @param updatepriceDTO
     * @return
     */
    public AlctApiBaseResDTO updatePrice(UpdatepriceDTO updatepriceDTO){
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        if(updatepriceDTO == null){
            result.setMessage(" updatepriceDTO 为空");
            return  result;
        }
        String token = getToken();
        if(StringUtils.isEmpty(token)){
            result.setMessage(" token 为空");
            return  result;
        }

        String path = "/api/v1/openapi/shipments/update-price";
        Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        headers.put("Content-Type", "application/json; charset=UTF-8");
        Map<String, String> querys = new HashMap<>();
        // 拼装请求body的json字符串
        String bodys = JSONObject.toJSONString(updatepriceDTO);
        log.info("更新辽宁税务司机运费请求-> {} {}", LN_TAX_DOMIAN + path, JSONUtil.toJsonStr(updatepriceDTO));

        try {
            bodys = SM2Utils.encryptByPublicKey(bodys, LN_TAX_SM2_PUBLICKEY);

            HttpResponse response = HttpUtils.doPut(LN_TAX_DOMIAN, path, "Put", headers, querys, bodys);
            int stat = response.getStatusLine().getStatusCode();
            if(stat != 200){
                log.info("OapiAlct56Service updatePrice Http code: :{}  | http header error msg:{} | Http body error msg: ",
                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
                result.setCode(String.valueOf(stat));
                result.setMessage(response.getFirstHeader("X-Ca-Error-Message").toString());
                return result;
            }
            String res = EntityUtils.toString(response.getEntity());
            log.info("辽宁航信税务更新运费回执 <- {} ",res);
            if (res.contains("token校验验证错误")) {
                String freshToken = getRefreshtoken();
                if (StrUtil.isEmpty(freshToken)) {
                    Thread.sleep(200);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                }
            }

            return JSONObject.parseObject(res, AlctApiBaseResDTO.class);
        } catch (Exception e) {
            log.info("OapiAlct56Service updatePrice Exception :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }
        return result;
    }


    /**
     * 上传合同
     * @param shippingNoteNumber 运单号
     */
    public AlctApiBaseResDTO uploadContract(String shippingNoteNumber, String contractNumber, String contractUrl) {
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        String token = getToken();
        if (StringUtils.isEmpty(token)) {
            result.setMessage("Token为空");
            return result;
        }

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("shipmentCode", shippingNoteNumber);
        jsonObject.put("transportContractNo", contractNumber);
        String bodys = jsonObject.toJSONString();

        String path = "/api/v1/openapi/uploadContractFile";
        Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        headers.put("Content-Type", "multipart/form-data;");
        try {

// Delete at 2023-12-27 for 目前辽宁税务不强制传图片格式的合同，可以先用PDF，图片格式这里存在PDF中文乱码问题还没有解决
//            String contractfilename = contractUrl.split("\\.")[0];
//            List<String> srcList = PdfToImageUtil.pdf2Jpg(this.uploadpath + File.separator, contractfilename);
//            if (srcList.size() == 0 || srcList.get(0).equals("")) {
//                result.setCode("-1");
//                result.setMessage(shippingNoteNumber + "合同文件转换图片失败");
//                return result;
//            }
//            String imagePath = this.uploadpath + File.separator + srcList.get(0);
//            log.info("PDF文件转换 {} {} {} ", this.uploadpath + File.separator, contractfilename, imagePath);
//            for (String imagePath1 : srcList) {
//                File file1 = new File(imagePath1);
//                request = request.form("fileDate", file1);
//            }

            contractUrl = this.uploadpath + File.separator + contractUrl;
            log.info("辽宁税务上传合同文件图片, {} {} {}", shippingNoteNumber, contractNumber, contractUrl);
            File file = new File(contractUrl);
            if (!file.exists()) {
                result.setCode("-1");
                result.setMessage(shippingNoteNumber + "合同图片文件不存在");
                return result;
            }

            bodys = SM2Utils.encryptByPublicKey(bodys, LN_TAX_SM2_PUBLICKEY);

            HttpRequest request = HttpRequest.post(LN_TAX_DOMIAN + path)
                    .addHeaders(headers)
                    .form("fileDate", file)
                    .form("content", bodys);

            String res = request.execute().body();
            log.info("辽宁税务上传合同文件回执 <- {} ",res);
            if (res.contains("token校验验证错误")) {
                String freshToken = getRefreshtoken();
                if (StrUtil.isEmpty(freshToken)) {
                    Thread.sleep(200);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                }
            }

            if (StrUtil.isEmpty(res)) {
                result.setCode("-1");
                result.setMessage(shippingNoteNumber + "上传合同出现错误");
                return result;
            }

            return JSONObject.parseObject(res, AlctApiBaseResDTO.class);
        } catch (Exception e) {
            e.printStackTrace();
            result.setCode("-1");
            result.setMessage(e.getMessage());
        }

        return result;
    }


    /**
     * 银行回单基础信息
     */
    public AlctApiBaseResDTO uploadBankReceipt(BankReceiptDTO bankReceiptDTO) {

        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        String token = getToken();
        if (StringUtils.isEmpty(token)) {
            result.setMessage("token为空");
            return result;
        }

        String path = "/api/v1/openapi/bankreceipt";

        Map<String, String> querys = new HashMap<>();
        Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        headers.put("Content-Type", "application/json; charset=UTF-8");

        String bodys = JSONObject.toJSONString(bankReceiptDTO);
        try {
            bodys = SM2Utils.encryptByPublicKey(bodys, LN_TAX_SM2_PUBLICKEY);

            HttpResponse response = HttpUtils.doPost(LN_TAX_DOMIAN, path, "Post", headers, querys, bodys);
            int stat = response.getStatusLine().getStatusCode();
            if(stat != 200){
                log.info("银行回单基础信息接口返回错误, Http code: :{}  | http header error msg:{} | Http body error msg: ",
                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
                result.setCode(String.valueOf(stat));
                result.setMessage(response.getFirstHeader("X-Ca-Error-Message").toString());
                return result;
            }
            String res = EntityUtils.toString(response.getEntity());
            log.info("辽宁航信税务银行回单基础信息回执 <- {} ",res);
            if (res.contains("token校验验证错误")) {
                String freshToken = getRefreshtoken();
                if (StrUtil.isEmpty(freshToken)) {
                    Thread.sleep(200);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                }
            }

            return JSONObject.parseObject(res, AlctApiBaseResDTO.class);
        } catch (Exception e) {
            log.info("辽宁航信税务银行回单基础信息回执异常 :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }

        return result;
    }

    /**
     * 银行回单文件上传
     * @param shippingNoteNumber 运单号
     * @param bankReceiptUrl 回单URL
     */
    public AlctApiBaseResDTO uploadBankReceiptFile(String shippingNoteNumber, String bankReceiptUrl) {

        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        String token = getToken();
        if (StringUtils.isEmpty(token)) {
            result.setMessage("token为空");
            return result;
        }

        String path = "/api/v1/openapi/uploadbankreceipt";
        Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        headers.put("Content-Type", "multipart/form-data;");
        try {
            log.info("辽宁税务上传银行回单图片, {} {} {}", shippingNoteNumber, bankReceiptUrl);
            File file = new File(bankReceiptUrl);
            if (!file.exists()) {
                result.setCode("-1");
                result.setMessage(shippingNoteNumber + "银行回单图片文件不存在");
                return result;
            }

            //使用SM2加密转换
            shippingNoteNumber = SM2Utils.encryptByPublicKey(shippingNoteNumber, LN_TAX_SM2_PUBLICKEY);

            HttpRequest request = HttpRequest.post(LN_TAX_DOMIAN + path)
                    .addHeaders(headers)
                    .form("fileDate", file)
                    .form("shipmentCode", shippingNoteNumber);

            String res = request.execute().body();
            log.info("辽宁税务上传银行回单图片回执 <- {} ",res);
            if (StrUtil.isEmpty(res)) {
                result.setCode("-1");
                result.setMessage(shippingNoteNumber + "上传合同出现错误");
                return result;
            }

            return JSONObject.parseObject(res, AlctApiBaseResDTO.class);
        } catch (Exception e) {
            e.printStackTrace();
            result.setCode("-1");
            result.setMessage(e.getMessage());
        }

        return null;
    }


    /**
     * 取消运单
     * @param shipmentCode 运单号
     * @return
     */
    public AlctApiBaseResDTO cancelShippingNote(String shipmentCode){
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        if (StringUtils.isEmpty(shipmentCode)) {
            result.setMessage("运单号不能为空");
            return result;
        }
        String token = getToken();
        if (StringUtils.isEmpty(token)) {
            result.setMessage("Token不能为空");
            return result;
        }

        Map <String, String> headers = new HashMap <>();
        //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
        headers.put("Authorization", "Bearer " + token);
        //根据API的要求，定义相对应的Content-Type
        headers.put("Content-Type", "application/json; charset=UTF-8");
        //Map<String, String> querys = new HashMap<>();

        try {
            shipmentCode = SM2Utils.encryptByPublicKey(shipmentCode, LN_TAX_SM2_PUBLICKEY);

            String path = "/api/v1/openapi/shipments?shipmentCode=" + shipmentCode;
            log.info("辽宁税务取消运单请求-> {}, {}", LN_TAX_DOMIAN + path);
            HttpRequest request = HttpRequest.delete(LN_TAX_DOMIAN + path)
                    .addHeaders(headers);
            String res = request.execute().body();
            log.info("辽宁税务取消运单回执 <- {} ",res);
            if (StrUtil.isEmpty(res)) {
                result.setCode("-1");
                result.setMessage(shipmentCode + " 删除税务平台运单失败");
                return result;
            }

//            HttpResponse response = HttpUtils.doDelete(LN_TAX_DOMIAN, path, "DELETE", headers, querys);
//            int stat = response.getStatusLine().getStatusCode();
//            if(stat != 200){
//                log.info("OapiAlct56Service cancelShippingNote Http code: :{}  | http header error msg:{} | Http body error msg: ",
//                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
//                result.setCode(String.valueOf(stat));
//                result.setMessage(response.getFirstHeader("X-Ca-Error-Message").toString());
//                return result;
//            }
//            String res = EntityUtils.toString(response.getEntity());
//            log.info("辽宁税务取消运单回执<- {} {}", stat, EntityUtils.toString(response.getEntity()));
            return JSONObject.parseObject(res, AlctApiBaseResDTO.class);
        } catch (Exception e) {
            log.info("OapiAlct56Service cancelShippingNote Exception :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }
        return result;
    }


    /**
     * 获取企业跳转url
     */
    public AlctApiBaseResDTO getDriverAuthUrl(String identityNo) {
        AlctApiBaseResDTO result = new AlctApiBaseResDTO();
        String token = getToken();
        if (StringUtils.isEmpty(token)) {
            result.setMessage("Token为空");
            return result;
        }

        try {
            String decodeIdentityNo = SM2Utils.encryptByPublicKey(identityNo, LN_TAX_SM2_PUBLICKEY);
            String path = "/api/v1/openapi/getUrl?identityNo=" + decodeIdentityNo;
            Map <String, String> headers = new HashMap <>();
            //最后在header中的格式(中间是英文空格)为Authorization:Bearer 83359fd73fe94948385f570e3c139105
            headers.put("Authorization", "Bearer " + token);
            //根据API的要求，定义相对应的Content-Type
            headers.put("Content-Type", "application/json; charset=UTF-8");
            Map<String, String> querys = new HashMap<>();

            log.info("辽宁税务获取实名认证请求 -> {} {}", identityNo, LN_TAX_DOMIAN + path);
            HttpResponse response = HttpUtils.doGet(LN_TAX_DOMIAN, path, "GET", headers, querys);
            int stat = response.getStatusLine().getStatusCode();
            if(stat != 200){
                log.warn("辽宁税务获取实名认证回执<- Http code: :{}  | http header error msg:{} | Http body error msg: ",
                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
                result.setCode(String.valueOf(stat));
                result.setMessage(response.getFirstHeader("X-Ca-Error-Message").toString());
                return result;
            }

            String res = EntityUtils.toString(response.getEntity());
            log.info("辽宁税务获取实名认证回执 <- {}", res);
            if (res.contains("token校验验证错误")) {
                String freshToken = getRefreshtoken();
                if (StrUtil.isEmpty(freshToken)) {
                    Thread.sleep(200);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                    redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                }
            }

            //嵌套try catch，返回SM2解密后的内容
            AlctApiBaseResDTO resdto = JSONUtil.toBean(res, AlctApiBaseResDTO.class, true);
            try {
                String decodeResult = SM2Utils.decryptByPrivateKey(resdto.getResult().toString(), LN_TAX_SM2_PRIVATEKEY);
                resdto.setResult(decodeResult);
                log.info("辽宁税务获取实名认证回执解密 <- {}", decodeResult);
                return resdto;
            } catch (Exception e) {
                e.printStackTrace();
                log.error("获取司机状态，SM2解密失败");
            }

            return resdto;
        } catch (Exception e) {
            e.printStackTrace();
            log.error("辽宁税务获取实名认证回执异常 :{} ",e.getMessage());
            result.setMessage(e.getMessage());
        }

        return result;
    }



    /*********************ruirui start***********************/
    public AlctApiBaseResDTO request(String token, String path, String method, String bodys){
        String reportDomainUrl = LN_TAX_DOMIAN;
        AlctApiBaseResDTO resDTO = new AlctApiBaseResDTO();
        try {
            bodys = SM2Utils.encryptByPublicKey(bodys, LN_TAX_SM2_PUBLICKEY);

            Map <String, String> headers = new HashMap <>();
            headers.put("Authorization", "Bearer " + token);
            headers.put("Content-Type", "application/json; charset=UTF-8");
            Map<String, String> querys = new HashMap<>();

            log.info("上传辽宁税务航信信息请求 -> url {}", path);
            HttpResponse response = null;
            switch (method){
                case "POST":
                    response = HttpUtils.doPost(reportDomainUrl, path, method, headers, querys, bodys);
                    break;
                case "DELETE":
                    response = HttpUtils.doDelete(reportDomainUrl, path, method, headers, querys);
                    break;
                case "PUT":
                    response = HttpUtils.doPut(reportDomainUrl, path, method, headers, querys, bodys);
                    break;
                case "GET":
                    response = HttpUtils.doGet(reportDomainUrl, path, method, headers, querys);
                    break;
                default:
                    resDTO.setMessage("不支持的请求类型：" + method);
                    break;
            }
            if(response == null){
                log.warn("上传辽宁税务回执为空 <- {} ", JSONUtil.toJsonStr(response));
                return resDTO;
            }
            int stat = response.getStatusLine().getStatusCode();
            if (stat == 200){
                String res = EntityUtils.toString(response.getEntity());
                log.info("上传辽宁税务回执 <- {} ", res);
                if (res.contains("token校验验证错误")) {
                    String freshToken = getRefreshtoken();
                    if (StrUtil.isEmpty(freshToken)) {
                        Thread.sleep(200);
                        redisUtil.del(OapiAlct56Constant.OAPIALCT56_TOKEN_KEY);
                        redisUtil.del(OapiAlct56Constant.OAPIALCT56_REFRESHTOKEN_KEY);
                    }
                }

                resDTO = JSONObject.parseObject(res, AlctApiBaseResDTO.class);
            }else{
                log.warn("上传辽宁税务失败, Http code: :{}  | http header error msg:{} | Http body error msg: ",
                        stat, response.getFirstHeader("X-Ca-Error-Message"), EntityUtils.toString(response.getEntity()));
                resDTO.setMessage("HTTP请求失败！" + stat);
            }
        } catch (Exception e) {
            log.error("Exception :{} ",e.getMessage());
            resDTO.setMessage("操作失败！" + e.getMessage());
        }
        return resDTO;
    }
    public AlctApiBaseResDTO submit(String path, Object DTO){
        String token = getToken();
        //判断token空
        if(StringUtils.isEmpty(token)) {
            AlctApiBaseResDTO resDTO = new AlctApiBaseResDTO();
            resDTO.setMessage("Token为空！");
            return resDTO;
        }
        return request(token, path, "POST", JSONObject.toJSONString(DTO));
    }


    public AlctApiBaseResDTO getVehicleStatus(String path, String urlParams) {
        String token = getToken();
        //判断token空
        if(StringUtils.isEmpty(token)) {
            AlctApiBaseResDTO resDTO = new AlctApiBaseResDTO();
            resDTO.setMessage("Token为空！");
            return resDTO;
        }

        log.info("辽宁税务查询挂车状态, {}", urlParams);
        try {
            path = path + SM2Utils.encryptByPublicKey(urlParams, LN_TAX_SM2_PUBLICKEY);
        } catch (Exception e) {
            log.error("SM2加密失败:{}", e.getMessage());
            AlctApiBaseResDTO rsp = new AlctApiBaseResDTO();
            rsp.setCode("-1");
            rsp.setMessage("查询车辆状态失败,数据加密错误");
            return rsp;
        }

        AlctApiBaseResDTO resdto = request(token, path, "GET", "{}");
        try {
            String decodeVehicle = SM2Utils.decryptByPrivateKey(resdto.getTrucks().toString(), LN_TAX_SM2_PRIVATEKEY);
            resdto.setTrucks(decodeVehicle);
            log.info("查询车辆状态回执解密 <- {}", decodeVehicle);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("获取车辆状态，SM2解密失败");
        }

        return resdto;
    }

    public AlctApiBaseResDTO getDriverStatus(String path, String urlParams) {
        String token = getToken();
        //判断token空
        if(StringUtils.isEmpty(token)) {
            AlctApiBaseResDTO resDTO = new AlctApiBaseResDTO();
            resDTO.setMessage("Token为空！");
            return resDTO;
        }

        try {
            path = path + SM2Utils.encryptByPublicKey(urlParams, LN_TAX_SM2_PUBLICKEY);
        } catch (Exception e) {
            log.error("SM2加密失败:{}", e.getMessage());
            AlctApiBaseResDTO rsp = new AlctApiBaseResDTO();
            rsp.setCode("-1");
            rsp.setMessage("查询司机状态失败,数据加密错误");
            return rsp;
        }

        AlctApiBaseResDTO resdto = request(token, path, "GET", "{}");
        try {
            String decodeDriver = SM2Utils.decryptByPrivateKey(resdto.getDriver().toString(), LN_TAX_SM2_PRIVATEKEY);
            resdto.setDriver(decodeDriver);
            log.info("查询司机状态回执解密 <- {}", decodeDriver);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("获取司机状态，SM2解密失败");
        }

        return resdto;
    }

    public AlctApiBaseResDTO delete(String path, Object DTO){
        String token = getToken();
        //判断token空
        if(StringUtils.isEmpty(token)) {
            AlctApiBaseResDTO resDTO = new AlctApiBaseResDTO();
            resDTO.setMessage("Token为空！");
            return resDTO;
        }
        return request(token, path, "DELETE", JSONObject.toJSONString(DTO));
    }

    public AlctApiBaseResDTO put(String path, Object DTO){
        String token = getToken();
        //判断token空
        if(StringUtils.isEmpty(token)) {
            AlctApiBaseResDTO resDTO = new AlctApiBaseResDTO();
            resDTO.setMessage("Token为空！");
            return resDTO;
        }
        return request(token, path, "PUT", JSONObject.toJSONString(DTO));
    }

    //登记司机
    public AlctApiBaseResDTO submitDriver(DriverDTO driverDTO){
        String path = "/api/v1/openapi/drivers";
        return submit(path, driverDTO);
    }

    //查询司机
//    public AlctApiBaseResDTO queryDriver(String identityNo) {
//        String path = "/api/v1/openapi/drivers?identityNo=" + identityNo;
//        return query(path, null);
//    }

    //司机税登
    public AlctApiBaseResDTO submitTaxpayer(List<String> driverIds){
        String path = "/api/v1/openapi/TaxDrivers";
        return submit(path, driverIds);
    }

    //登记车辆
    public AlctApiBaseResDTO submitVehicle(VehicleDTO vehicleDTO){
        String path = "/api/v1/openapi/trucks";
        return submit(path, vehicleDTO);
    }

    public AlctApiBaseResDTO queryVehicle(String licensePlateNo){
        return getVehicleStatus("/api/v1/openapi/trucks?licensePlateNo=", licensePlateNo);
    }


    //绑定挂车关系
    public AlctApiBaseResDTO submitVehicleTrailer(Map<String, String> dto) {
        String path = "/api/v1/openapi/trucks/trailer-mapping";
        return submit(path, dto);
    }

    //解绑挂车关系
    public AlctApiBaseResDTO deleteVehicleTrailer(Map<String, String> dto) {
        String path = "/api/v1/openapi/trucks/trailer-mapping";
        return delete(path, dto);
    }

    //上传照片
    public AlctApiBaseResDTO submitImage(ImageDTO imageDTO){
        String path = "/api/v1/openapi/images";
        return submit(path, imageDTO);
    }

    //增加司机与车辆绑定
    public AlctApiBaseResDTO vehicleBoundToDriver(String identityNo, List<String> trucks) {
        try {
            identityNo = SM2Utils.encryptByPublicKey(identityNo, LN_TAX_SM2_PUBLICKEY);
        } catch (Exception e) {
            log.error("SM2加密失败:{}", e.getMessage());
            AlctApiBaseResDTO rsp = new AlctApiBaseResDTO();
            rsp.setCode("-1");
            rsp.setMessage("上传司机与车辆绑定关系失败,数据加密错误");
            return rsp;
        }

        String path = "/api/v1/openapi/drivers/" + identityNo + "/trucks";
        return submit(path, trucks);
    }

    //增加

    /**
     * 删除司机与车辆绑定
     * @param identityNo
     * @param licensePlateNo
     * @return
     */
    public AlctApiBaseResDTO deleteVehicleDriverBound(String identityNo, String licensePlateNo){
        String path = "/api/v1/openapi/drivers/" + identityNo + "/trucks?licensePlateNo=" + licensePlateNo;
        return delete(path, null);
    }
    /*********************ruirui end***********************/


//    public static void testDriverSubmit(OapiAlct56Service oapiAlct56Service){
//        try {
//            DriverDTO driverDTO = new DriverDTO();
//            driverDTO.setDriverName("李天伟");
//            driverDTO.setMobile("18340812977");
//            driverDTO.setSendActivationSms(false);
//
//            Identity identity = new Identity();
//            identity.setIdentityNo("130429198101293632");
//            identity.setEffectiveStartDate("2009-04-30");
//            identity.setEffectiveEndDate("2029-04-30");
//            identity.setIsEndless(false);
//
//            DrivingLicense drivingLicense = new DrivingLicense();
//            drivingLicense.setLicenseNo("130429198101293632");          //	驾驶证号	字符串	15或18位	是	第18位可以为X，其他为数字
//            drivingLicense.setLicenseFirstGetDate("2021-03-11");//	首次驾照签发日期	日期		是
//            drivingLicense.setLicenseType("A2");        //	驾驶证类型	字符串		是
//            drivingLicense.setEffectiveStartDate("2013-03-19"); //	有效期开始日期	日期		是
//            drivingLicense.setEffectiveEndDate("2023-03-19");   //	有效期结束	日期		是	必须大于当前日期，否则报错
//            drivingLicense.setApproveOrganization("河北省邯郸市公安局交通警察支队");//	驾驶证发证机关	字符串	小于200位	否
//
//            Taxpayer taxpayer = new Taxpayer();
//            taxpayer.setTaxpayerName("李天伟");        //	名称	字符串		否
//            taxpayer.setTaxpayerIdentityNo("130429198101293632");  //	身份证号码	15/18位		否	第18位可以为X，其他为数字
//            taxpayer.setTaxpayerAddress("河北省邯郸市永年县曲陌乡曲陌四分村三区104号");     //	身份证地址	最长200		否
//            taxpayer.setTaxpayerMobile("18340812977");      //	纳税人手机号	11位数字		否
//            taxpayer.setBankName("");            //	开户行名称	最长100		否
//            taxpayer.setBankAccount("");         //	账号	最长21位		否
//
//            driverDTO.setIdentity(identity);
//            driverDTO.setDrivingLicense(drivingLicense);
//            driverDTO.setTaxpayer(taxpayer);
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitDriver(driverDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testVehicleSubmit(OapiAlct56Service oapiAlct56Service){
//        try {
//            VehicleDTO vehicleDTO = new VehicleDTO();
//            vehicleDTO.setLicensePlateNo("冀D8H927");                     //	车辆牌照	字符串	7/8位	是	7/8位
//            vehicleDTO.setStandardVehicleType("重型半挂牵引车");                //	车辆类型	字符串	最长20为	否
//            vehicleDTO.setVehicleIdentityCode("LXUG4NY30K4060161");                //	车架号	字符	17位	是	17位数字与字母组合
//            vehicleDTO.setBrand("东风牌EQ4250GD5N1");                              //	汽车品牌	字符	最长20位	否
//            vehicleDTO.setEngineNumber("");                       //	发动机号	字符	最长20位	否
//            vehicleDTO.setOwner("杨宇飞");                              //	所有人	字符	最长20位	是
//            vehicleDTO.setUsage("货运");                              //	使用性质	字符	最长20位	是
//            vehicleDTO.setLoad(40);                               //	载重	数字	最长6位	是	单位公斤
//            vehicleDTO.setTransportLicenseNo("610826009394");      //	道路运输证号	数字	200位	否
//            vehicleDTO.setTransportLicenseExpireDate("");         //	道路运输证有效期	日期		否
//            vehicleDTO.setVehicleRegistrationCertificateNo("610826009394");   //	机动车登记证书编号	字符	最长20	否
//            vehicleDTO.setAffiliationAgreementUrl("");            //	挂靠协议电子合同	字符	最长200	否
//            vehicleDTO.setNfcId("");                              //	Nfc标签	字符	最长20	否
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitVehicle(vehicleDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit1(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Driver.getValue());//照片种类
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.IdentityFront.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit2(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Driver.getValue());//照片种类
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.IdentityBack.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit3(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Driver.getValue());//照片种类
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.FullFace.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit4(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Driver.getValue());//照片种类
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.DrivingLicense.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit5(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Driver.getValue());//照片种类
////            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.QualificationCertificate.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit6(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Driver.getValue());//照片种类
////            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.TaxpayerIdentity.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit7(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Driver.getValue());//照片种类
////            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.TaxpayerBankCard.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit8(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Truck.getValue());//照片种类
//            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
//            imageDTO.setImageType(ImageType.VehicleLicenseMain.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit9(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Truck.getValue());//照片种类
//            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
////            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.VehicleLicenseFront.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit10(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Truck.getValue());//照片种类
//            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
////            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.VehicleLicenseBack.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit11(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Truck.getValue());//照片种类
//            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
////            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.TransportationCert.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit12(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Truck.getValue());//照片种类
//            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.VehicleRegistration.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//    public static void testImageSubmit13(OapiAlct56Service oapiAlct56Service){
//        try {
//            ImageDTO imageDTO = new ImageDTO();
//            imageDTO.setImageCategory(ImageCategory.Truck.getValue());//照片种类
//            imageDTO.setLicensePlateNo("冀D8H927");//车牌号
//            imageDTO.setIdentityNo("130429198101293632");//身份证号
//            imageDTO.setImageType(ImageType.AffiliationAgreement.getValue());//照片类型
//            String imagePath = "C:/opt/upFiles/yyf.jpg";
//            imageDTO.setFileExt(imagePath.substring(imagePath.lastIndexOf("."), imagePath.length()));//文件类型
//            String base64Str = ImageCompressUtil.compressSrcImageToBase64(imagePath,500);
//            imageDTO.setFileData(base64Str);//照片base64串
//
//            AlctApiBaseResDTO res = oapiAlct56Service.submitImage(imageDTO);
//            System.out.println(res);
//        }catch (Exception ex){
//            System.out.println(ex.getMessage());
//        }
//    }
//
//
//
//    public static void main(String[] args) {
//
//        DriverDTO driverDTO = new DriverDTO();
//        driverDTO.setDriverName("李天伟");
//        driverDTO.setMobile("18340812977");
//        driverDTO.setSendActivationSms(false);
//
//        Identity identity = new Identity();
//        identity.setIdentityNo("130429198101293632");
//        identity.setEffectiveStartDate("2009-04-30");
//        identity.setEffectiveEndDate("2029-04-30");
//        identity.setIsEndless(false);
//
//        DrivingLicense drivingLicense = new DrivingLicense();
//        drivingLicense.setLicenseNo("130429198101293632");          //	驾驶证号	字符串	15或18位	是	第18位可以为X，其他为数字
//        drivingLicense.setLicenseFirstGetDate("2021-03-11");//	首次驾照签发日期	日期		是
//        drivingLicense.setLicenseType("A2");        //	驾驶证类型	字符串		是
//        drivingLicense.setEffectiveStartDate("2013-03-19"); //	有效期开始日期	日期		是
//        drivingLicense.setEffectiveEndDate("2023-03-19");   //	有效期结束	日期		是	必须大于当前日期，否则报错
//        drivingLicense.setApproveOrganization("河北省邯郸市公安局交通警察支队");//	驾驶证发证机关	字符串	小于200位	否
//
//        Taxpayer taxpayer = new Taxpayer();
//        taxpayer.setTaxpayerName("李天伟");        //	名称	字符串		否
//        taxpayer.setTaxpayerIdentityNo("130429198101293632");  //	身份证号码	15/18位		否	第18位可以为X，其他为数字
//        taxpayer.setTaxpayerAddress("河北省邯郸市永年县曲陌乡曲陌四分村三区104号");     //	身份证地址	最长200		否
//        taxpayer.setTaxpayerMobile("18340812977");      //	纳税人手机号	11位数字		否
//        taxpayer.setBankName("");            //	开户行名称	最长100		否
//        taxpayer.setBankAccount("");         //	账号	最长21位		否
//
//        driverDTO.setIdentity(identity);
//        driverDTO.setDrivingLicense(drivingLicense);
//        driverDTO.setTaxpayer(taxpayer);
//
//
//
//
//
//
//    }
//    static void testCancelShippingNote() {
//        OapiAlct56Service oapiAlct56Service = new OapiAlct56Service();
//        AlctApiBaseResDTO a =  oapiAlct56Service.cancelShippingNote("YD202107040444074941");
//        System.out.println("4.业务订单数据元素接口调用:" + a);
//    }
//
//
//    static void testUpdatePrice() {
//        OapiAlct56Service oapiAlct56Service = new OapiAlct56Service();
//        UpdatepriceDTO updatepriceDTO = new UpdatepriceDTO();
//        updatepriceDTO.setShipmentCode("YD202107050444074941");
//        updatepriceDTO.setPrice(537831);
//        updatepriceDTO.setComments("YD202107040444074941");
//
//        AlctApiBaseResDTO a =  oapiAlct56Service.updatePrice(updatepriceDTO);
//        System.out.println("4.业务订单数据元素接口调用:" + a);
//    }
//
//
//
//
//    static void testUpImages() {
//        OapiAlct56Service oapiAlct56Service = new OapiAlct56Service();
//        ImagesDTO imagesDTO =  new ImagesDTO();
//        imagesDTO.setShipmentCode("YD202107040444074941");
//        imagesDTO.setFileName("榜单");
//        String urlFile = "/Users/duanlikao/Downloads/壁纸.jpg";
//        imagesDTO.setFileData(WaterMarkUtil.imageToBase64(urlFile));
//
//        AlctApiBaseResDTO a =  oapiAlct56Service.upImages(imagesDTO);
//        System.out.println("4.业务订单数据元素接口调用:" + a);
//    }
//
//
//    static void testsynTraces(){
//        OapiAlct56Service oapiAlct56Service = new OapiAlct56Service();
//        TracesDTO tracesDTO = new TracesDTO();
//        tracesDTO.setShipmentCode("YD202107040444074941");
//        tracesDTO.setCooridnationType("Baidu");
//        List<TracesInfoDTO> tracesInfoDTOS =  new ArrayList<>();
//        TracesInfoDTO tracesInfoDTO = new TracesInfoDTO();
//        tracesInfoDTO.setTime("2021-07-04T04:44:08");
//        tracesInfoDTO.setLatitude(new BigDecimal("108.9566960"));
//        tracesInfoDTO.setLongitude(new BigDecimal("35.6659470"));
//        tracesInfoDTOS.add(tracesInfoDTO);
//
//        tracesDTO.setTraces(tracesInfoDTOS);
//        AlctApiBaseResDTO a =  oapiAlct56Service.synTraces(tracesDTO);
//        System.out.println("4.业务订单数据元素接口调用:" + a);
//    }
//
//
//    static void testCreateShippingNote(){
//        OapiAlct56Service oapiAlct56Service = new OapiAlct56Service();
//        //4.业务订单数据元素
//        BodyDTO bodyDTO = new BodyDTO();
//        bodyDTO.setShippingNoteNumber("YD202107070444074941");
//        bodyDTO.setConsignmentDateTime("2021-07-05T04:44:08");
//        bodyDTO.setPickupLocation("陕西双龙煤业开发有限责任公司");
//        bodyDTO.setPickupCountrySubdivisionCode(610632);
//        bodyDTO.setUnloadLocation("天源煤炭");
//        bodyDTO.setUnloadCountrySubdivisionCode(152921);
//        bodyDTO.setDistance(477d);
//        bodyDTO.setPlanPickupTimeStart("2021-06-02T18:13:26");
//        bodyDTO.setPlanPickupTimeEnd("2021-07-20T18:13:26");
//        bodyDTO.setPlanUnloadTimeStart("2021-06-02T18:13:26");
//        bodyDTO.setPlanUnloadTimeEnd("2021-07-20T18:13:26");
//        bodyDTO.setDriverIdentification("130429198101293632");
//        bodyDTO.setVehicleNumber("冀D8H927");
//        bodyDTO.setTotalWeight(40d);
//        bodyDTO.setTotalCube(0d);
//
//        PriceInfoDTO priceInfoDTO = new PriceInfoDTO();
//        priceInfoDTO.setPrice(Long.valueOf("337831"));
//        bodyDTO.setPriceInfo(priceInfoDTO);
//
//
//        List<GoodsInfoDTO> goodsInfoDTOS =  new ArrayList <>();
//        GoodsInfoDTO goodsInfoDTO=  new GoodsInfoDTO();
//        goodsInfoDTO.setDescriptionOfGoods("精煤");
//        goodsInfoDTO.setGoodsPropertyTypeCode(50);
//        goodsInfoDTO.setUnitWight(40000d);
//        goodsInfoDTO.setUnitVol(0d);
//
//        goodsInfoDTOS.add(goodsInfoDTO);
//        bodyDTO.setGoodsInfo(goodsInfoDTOS);
//
//        ConsigneeInfoDTO consigneeInfoDTO = new ConsigneeInfoDTO();//收货
//        consigneeInfoDTO.setConsignee("赵军");
//        consigneeInfoDTO.setCustomerName("内蒙古云扬锦诚供应链管理有限公司");
//        consigneeInfoDTO.setIdentificationNumberOfTheTaxpayer("91150304MA7YN7AL0E");
//        consigneeInfoDTO.setTelephone("17719732286");
//        bodyDTO.setConsigneeInfo(consigneeInfoDTO);
//       // 发货人信息
//        ConsignorInfoDTO consignorInfoDTO = new ConsignorInfoDTO();
//        consignorInfoDTO.setConsigner("李胜利");
//        consignorInfoDTO.setCustomerName("内蒙古云扬锦诚供应链管理有限公司");
//        consignorInfoDTO.setIdentificationNumberOfTheTaxpayer("91150304MA7YN7AL0E");
//        consignorInfoDTO.setTelephone("17719732286");
//        bodyDTO.setConsignorInfo(consignorInfoDTO);
//
//        AlctApiBaseResDTO a =  oapiAlct56Service.createShippingNote(bodyDTO);
//        System.out.println("4.业务订单数据元素接口调用:" + a);
//    }

}
